﻿@model EWFieldDefinitionCollection
@{
    var ownerId = this.Url.RequestContext.RouteData.Values["id"];
}
<div class="easyweb-ewfields">
    <table class="ui-widget ui-helper-reset easyweb-ewsimple">
        <thead class="ui-helper-reset ui-widget-content">
            <tr>
                <th style="width: 30em;">@EWWebResources.Field_GridTitle_InternalName</th>
                <th>@EWWebResources.Field_GridTitle_Type</th>
            </tr>
        </thead>
        <tbody class="ui-helper-reset ui-widget-content">
            @if (Model != null)
            {
                foreach (var field in Model.OrderBy(m => m.InternalName))
                {
                <tr>
                    <td style="width: 30em;">@Html.RouteLink(field.InternalName, "EasyWeb_Field", new { action = "Details", ownerId = ownerId, id = field.Id })</td>
                    <td>@field.GetDisplayName()</td>
                </tr>
                }
            }
        </tbody>
    </table>
    <p>@Html.RouteLink(EWWebResources.Field_Button_Add, "EasyWeb_Field", new RouteValueDictionary() { { "action", "Create" }, { "ownerId", ownerId } }, new Dictionary<string, object>() { { "class", "easyweb-ewsimple-link-button" } })</p>
</div>
